<template>
	<view class="animated fadeIn faster " style="min-height: 100vh;">
    <view class="setting-list p-2">
      <view class="setting-item bg-fff p-2 rounded10 d-flex d-flex-between d-flex-middle mb-2">
        <text class="font30 color-92">使用https协议播放视频</text>
        <switch class="small-switch" :checked="useHttps" @change="toggleUseHttps" />
      </view>

      <view class="setting-item bg-fff p-2 rounded10 d-flex d-flex-between d-flex-middle mb-2">
        <text class="font30 color-92">自动播放下一节视频课时</text>
        <switch class="small-switch"  :checked="autoPlayNext" @change="toggleAutoPlayNext" />
      </view>
    </view>
	</view>
</template>

<script>
	import { userApi } from '@/http/userApi.js';
	import { fileApi } from '@/http/fileApi.js';
	import store from '@/store/index.js';
	import { USER_TOKEN } from '@/constants/local-storage-key-const';
	import { mapState } from "vuex"
	export default {
		data() {
			return {
          useHttps: true,
          autoPlayNext: false,
        }
		},
		methods: {
      toggleUseHttps(e) {
        this.useHttps = e.target.value;
        // 保存设置到本地存储
        uni.setStorageSync('useHttps', this.useHttps);
      },

      toggleAutoPlayNext(e) {
        this.autoPlayNext = e.target.value;
        uni.setStorageSync('autoPlayNext', this.autoPlayNext);
      }
		}
	}
</script>

<style scoped>
.small-switch {
  transform: scale(0.9);
  zoom: 0.9;
}
</style>
